<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/manager/easyui/themes/default/easyui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/manager/easyui/themes/icon.css}">
    <script type="text/javascript" th:src="@{/manager/easyui/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/manager/easyui/jquery.easyui.min.js}"></script>
    <script type="text/javascript">
          $(function(){
              $("#tab").datagrid({
                  url:"/manager/test/findAll",
                  method: 'post',
                  title:"数据列表",
                  columns:[
                      [
                      {field:'id',title:'ID',width:100,align:"center"},
                      {field:'username',title:'用户名称',width:100,align:"center"}
                  ]
                  ],
                  pagination:true,
                  toolbar:"#tb"
            /*      toolbar:[
                        {
                          text:"修改",
                          iconCls:"icon-edit",
                          handler:function(){
                              alert("edit");
                          }
                      },'-',{
                          text:"新增",
                          iconCls:"icon-add",
                          handler:function(){
                              alert("add");
                          }

                      }

                  ]*/


              });
          });

          function query(){
              /*$('#tab').datagrid({
                  queryParams: {
                      name: $("#name").val()
                  }
              });*/

            /*  $('#tab').datagrid("load",{
                  loadname: $("#name").val()
              });*/

              $('#tab').datagrid("reload",{
                  reloadname: $("#name").val()
              });


          }
    </script>
</head>

<body>
     <div id="tb" style="padding: 3px;">
          <input id="name" style="line-height: 26px;border: 1px solid #cccccc"/>
          <button type="button" onclick="query()">查询</button>
     </div>
    <table id="tab"></table>
</body>
</html>